#include <stdio.h>

int main() {
    int mo[12], x = 0, save = 0, end;
    for (int i = 0; i < 12; i++) {
        scanf("%d", &mo[i]);
    }
    for (int i = 0; i < 12; i++) {
        x = 300 - mo[i] + x;
        save += (x - x % 100);

        if (x < 0) {
            printf("-%d", i + 1);
            return 0;
        }
        x %= 100;
    }
    end = save * 1.2 + x;
    printf("%d", end);
    return 0;
}
